export class storecoupon {
  id?: number;
  name = '';
  money = ''
  isLimited = ''
  total = 0
  lastTotal = ''
  useType = 1
  primaryKey = ''
  minPrice = 0
  receiveStartTime = ''
  receiveEndTime = ''
  isFixedTime = ''
  useStartTime = ''
  useEndTime = ''
  day = ''
  type = ''
  sort = ''
  status = ''
  isDel = ''
  createTime = ''
  updateTime = ''
  isForever = false
  checked = false
  constructor(data?: storecoupon) {
    data && this.setProps(data);
  }

  setProps(data: storecoupon) {
    (Object.keys(this) as Array<keyof Istorecoupon>).forEach((key) => {
      // @ts-ignore
      this[key] = data[key]
    })
  }
}

export type Istorecoupon = Omit<storecoupon, 'setProps'>